************************************************************
****************** REPLICATION CODE ************************
************************************************************
* For: Rigterink, The Wane of Command, APSR				   *
* Tables and Figures in Appendix						   *
************************************************************
* Content of file:										   *
/*														   *
1. Preliminaries and setting directory					   *
2. Programs needed to produce main results				   *
3. Appendix section B									   *
4. Appendix section C									  */
************************************************************

/*----------------------------------------------------------
---------- Preliminaries and setting directory -------------
----------------------------------------------------------*/

clear all
version 14
set more off

*******************************
*** Set your directory here ***
*******************************
cd "[directory]"

cap log close
log using log\Rigterink_drones_replication_appendix.log, replace


/*----------------------------------------------------------
------------Programs needed to produce results -------------
----------------------------------------------------------*/

* To calculate Wald statistics for joint significance of coefficients 
prog define Fstats, eclass
{
capture noisily: testparm L*_bigfishdied
capture: eret scalar lagF = r(p)
capture noisily: testparm F*_bigfishdied
capture: eret scalar leadF = r(p)
capture: testparm L*_bigfishtarget
capture: eret scalar lagFtarget = r(p)
capture: testparm F*_bigfishtarget
capture: eret scalar leadFtarget = r(p)
local depvar = e(depvar)
sum `depvar' if (L1_bigfishtarget==1 & L1_bigfishdied==0) | (L2_bigfishtarget==1 & L2_bigfishdied==0) | (L3_bigfishtarget==1 & L3_bigfishdied==0) | (L4_bigfishtarget==1 & L4_bigfishdied==0) | (L5_bigfishtarget==1 & L5_bigfishdied==0) | (L6_bigfishtarget==1 & L6_bigfishdied==0) 
eret scalar cmean = r(mean)
}

end

* To calculate Wald statistics for affiliate-month level regressions
prog define affilFstats, eclass
{
capture noisily: testparm L*_*parentdied
capture: eret scalar lagFparent = r(p)
capture noisily: testparm F*_*parentdied
capture: eret scalar leadFparent = r(p)
capture noisily: testparm L*_*parenttarget
capture: eret scalar lagFtarget = r(p)
capture noisily: testparm F*_*parenttarget
capture: eret scalar leadFtarget = r(p)
capture noisily: testparm L*_ownbigfishdied
capture: eret scalar lagFown = r(p)
capture noisily: testparm F*_ownbigfishdied
capture: eret scalar leadFown = r(p)
capture noisily: testparm L*_bigfishdied
capture: eret scalar lagF = r(p)
capture noisily: testparm F*_bigfishdied
capture: eret scalar leadF = r(p)
capture noisily: testparm L*_bigfishtarget
capture: eret scalar lagFtarget1 = r(p)
capture noisily: testparm F*_bigfishtarget
capture: eret scalar leadFtarget1 = r(p)
local depvar = e(depvar)
capture noisily: sum `depvar' if (L1_bigfishtarget==1 & L1_bigfishdied==0) | (L2_bigfishtarget==1 & L2_bigfishdied==0) | (L3_bigfishtarget==1 & L3_bigfishdied==0) | (L4_bigfishtarget==1 & L4_bigfishdied==0) | (L5_bigfishtarget==1 & L5_bigfishdied==0) | (L6_bigfishtarget==1 & L6_bigfishdied==0) 
capture: eret scalar cmean = r(mean)
capture noisily: sum `depvar' if (L1_stanfordparenttarget==1 & L1_stanfordparentdied==0) | (L2_stanfordparenttarget==1 & L2_stanfordparentdied==0) | (L3_stanfordparenttarget==1 & L3_stanfordparentdied==0) | (L4_stanfordparenttarget==1 & L4_stanfordparentdied==0) | (L5_stanfordparenttarget==1 & L5_stanfordparentdied==0)| (L6_stanfordparenttarget==1 & L6_stanfordparentdied==0) 
capture: eret scalar acmean = r(mean)
}

end

/*----------------------------------------------------------
------------------------ Section B -------------------------
----------------------------------------------------------*/

use "dta/Rigterink_drones_replication_descriptives.dta", clear

**************************
*** Figures B.1 - B.5  ***
**************************

preserve

* Defining group labels
label define groups 1 "Al-Qaida" 2 "Harkatul Jihad-e-Islami" 3 "Haqqani Network" 4 "Isl. Movement of Uzbekistan" ///
5 "Taliban" 6 "Lashkar-e-Islam" 7 "Jund al-Khilafa" 8 "Punjabi Taliban" 9 "Tehrik-i-Taliban Pakistan" ///
10 "East Turkistan Islamic Movement" 11 "Al-Badr" 12 "Taliban (Pakistan)" 13 "Islamic Jihad Union" 

* Generating hit/miss indicator

gen hit = 1 if bigfishdied==1
replace hit = 0 if bigfishtarget==1 & bigfishdied==0

gen miss = 1 if bigfishtarget==1 & bigfishdied==0

* Labelling periodid

forvalues i = 1(1)144 {
	local label = floor((`i'-1)/12+2004)
	label define periods `i' "`label'", modify
}

label val periodid periods

* Time series of terrorist attacks by group including hit and miss 'lines'

local number = 0 

foreach i in 1 2 3 5 9 {

	local number = `number'+1
	
	foreach j in miss hit {
	
		qui sum `j' if groupid==`i'
		local count`j' = r(sum)

		local count = 0
	
		forvalues k = 1(1)1733 {
			if `j'[`k']==1 & groupid[`k']==`i' & `count'<`count`j'' {
				local count = `count'+1
				local `j'`count'=periodid[`k']
			}
		}	
	
	local `j'lines =""
		
	forvalues n=1(1)`count`j'' {
		if `n'==1{
			local `j'lines = "``j'`n''"
			}
		else {
			local `j'lines = "``j'lines' ``j'`n''"
			}
		}
	}
	
	local xlinehit = "xline(`hitlines', lcolor(gray) lpattern(solid))"
	local xlinemiss = "xline(`misslines', lcolor(black) lpattern(dash))"
	
	local group : label groups `i'
	
	if `i'==9{
		local xaxis = "xlabel(49(12)133, valuelabel)"
	}
	else {
		local xaxis = "xlabel(1(12)133, valuelabel)"
	}
	
	graph twoway (line terratt periodid if groupid==`i', `xlinemiss' `xlinehit' lcolor(black)) ///
	|| (scatteri 0 50, recast(line) lcolor(gray) lpattern(solid)) ///
	|| (scatteri 0 50, recast(line) lcolor(black) lpattern(dash)), ///
	plotregion(style(none)) graphregion(ifcolor(white) fcolor(white) color(white) icolor(white)) ///
	ylabel(#5, format(%9.0f)) title("`group'") ///
	xtitle("") `xaxis'	///
	legend(order(2 "Drone hit" 3 "Drone 'miss'"))
	
	graph export graphs/Rigterink_AfigB`number'.pdf, replace
	
}


restore 


********************************************
*** NOTE: Table B.1 is in separate file  ***
********************************************

* Rigterink_drones_replication_appendix_reportingbias.do


*********************************************************************
*** NOTE: Figures B.6 and B.7, and Table B.2 are in separate file ***
*********************************************************************

* Rigterink_drones_replication_appendix_attributionbias.do


********************************************
*** NOTE: Table B.8 is in separate file  ***
********************************************

* Rigterink_drones_replication_appendix_samplesize.do


*******************
*** Figure B.9  ***
*******************

use "dta/Rigterink_drones_replication_maindataset.dta", clear

* Distribution of error term from baseline model

*** Raw count of terrorist attacks
reghdfe terratt_unlog *bigfishtarget *bigfishdied *dronestrike, absorb(FE_GROUP=i.groupid FE_MONTH=i.periodid) vce(, bw(12))
predict residuals, r

* Residual histogram
hist residuals, normal normopts(lcolor(red)) lcolor(black) color(white) ///
plotregion(style(none)) graphregion(ifcolor(white) fcolor(white) color(white) icolor(white)) ///
title("Count DV: Histogram", color(black)) ///
saving(graphs/residual_hist_raw, replace)

* Residual Q-Q plot
qnorm residuals, color(black) rlopts(lcolor(red)) ///
plotregion(style(none)) graphregion(ifcolor(white) fcolor(white) color(white) icolor(white)) ///
title("Count DV: Q-Q plot", color(black)) ///
saving(graphs/residual_qq_raw, replace)


*** Log-transformed number of terrorist attacks
reghdfe terratt *bigfishtarget *bigfishdied *dronestrike, absorb(FE_GROUP_log=i.groupid FE_MONTH_log=i.periodid) vce(, bw(12))
predict logresiduals, r

* Residual histogram
hist logresiduals, normal normopts(lcolor(red)) lcolor(black) color(white) ///
plotregion(style(none)) graphregion(ifcolor(white) fcolor(white) color(white) icolor(white)) ///
title("Log-transformed DV: Histogram", color(black)) ///
saving(graphs/residual_hist_log, replace)

* Residual Q-Q plot
qnorm logresiduals, color(black) rlopts(lcolor(red)) ///
plotregion(style(none)) graphregion(ifcolor(white) fcolor(white) color(white) icolor(white)) ///
title("Log-transformed DV: Q-Q plot", color(black)) ///
saving(graphs/residual_qq_log, replace)

* Combining all graphs

graph combine graphs/residual_hist_raw.gph graphs/residual_qq_raw.gph graphs/residual_hist_log.gph graphs/residual_qq_log.gph, rows(2) cols(2) ///
graphregion(ifcolor(white) fcolor(white) color(white) icolor(white)) ///
title("Error terms against normal distribution", color(black)) ///
xsize(7)

graph export graphs/Rigterink_AFigB9.pdf, replace


******************
*** Table B.3  ***
******************

use "dta/Rigterink_drones_replication_maindataset.dta", clear

* Baseline specification
reghdfe terratt F*bigfishtarget bigfishtarget L*_bigfishtarget F*bigfishdied bigfishdied L*_bigfishdied *dronestrike, absorb(i.groupid i.periodid) vce(, bw(12))
Fstats

outreg2 using tables/Rigterink_ATabB3, replace label ///
keep(bigfishdied L*_bigfishdied) ///
adds("p-val lags hit", e(lagF), "p-val leads hit", e(leadF), "p-val lags targeted", e(lagFtarget), "p-val leads targeted", e(leadFtarget), "Control mean", e(cmean)) adec(4) ///
addtext("Includes 6 leads", "YES", "Group FE", "YES", "Month FE", "YES", "Group-Month trend", "NO",  "Standard errors", "N. West") ///
nonotes addnote("Standard errors in parentheses", "* p<0.1 ** p<0.05 *** p<0.01") ///
ctitle("Baseline", "Terr.att.")

* Only lags
reghdfe terratt bigfishtarget bigfishdied dronestrike L?_bigfishtarget L?_bigfishdied L?_dronestrike, absorb(i.groupid i.periodid) vce(, bw(12))
Fstats

outreg2 using tables/Rigterink_ATabB3, append label tex(frag)  ///
keep(bigfishdied L*_bigfishdied) ///
adds("p-val lags hit", e(lagF), "p-val lags targeted", e(lagFtarget), "Control mean", e(cmean)) adec(4) ///
addtext("Includes 6 leads", "NO", "Group FE", "YES", "Month FE", "YES", "Group-Month trend", "NO",  "Standard errors", "N. West") ///
nonotes addnote("Standard errors in parentheses", "* p<0.1 ** p<0.05 *** p<0.01") ///
ctitle("Only lags", "Terr.att.")

* Only leads
reghdfe terratt F?_bigfishtarget F?_bigfishdied F?_dronestrike, absorb(i.groupid i.periodid) vce(, bw(12))
Fstats

outreg2 using tables/Rigterink_ATabB3, append label tex(frag)  ///
keep(bigfishdied L*_bigfishdied) ///
adds("p-val leads hit", e(leadF), "p-val leads targeted", e(leadFtarget), "Control mean", e(cmean)) adec(4) ///
addtext("Includes 6 leads", "YES", "Group FE", "YES", "Month FE", "YES", "Group-Month trend", "NO",  "Standard errors", "N. West") ///
nonotes addnote("Standard errors in parentheses", "* p<0.1 ** p<0.05 *** p<0.01") ///
ctitle("Only leads", "Terr.att.")

* Restricting sample to periods with at least one lead or lag

preserve 

foreach X of varlist L?_bigfishtarget F?_bigfishtarget bigfishtarget {
	egen any`X' = max(`X'), by(periodid)
}

egen keep = rowmax(any*bigfishtarget)
drop any*bigfishtarget

reghdfe terratt *bigfishtarget *bigfishdied *dronestrike if keep==1, absorb(i.groupid i.periodid) vce(, bw(12))
Fstats

outreg2 using tables/Rigterink_ATabB3, append label tex(frag)  ///
keep(bigfishdied L*_bigfishdied) ///
adds("p-val lags hit", e(lagF), "p-val leads hit", e(leadF), "p-val lags targeted", e(lagFtarget), "p-val leads targeted", e(leadFtarget), "Control mean", e(cmean)) adec(4) ///
addtext("Includes 6 leads", "YES", "Group FE", "YES", "Month FE", "YES", "Group-Month trend", "NO",  "Standard errors", "N. West") ///
nonotes addnote("Standard errors in parentheses", "* p<0.1 ** p<0.05 *** p<0.01") ///
ctitle("$<$7 mnths", "from targeted", "Terr.att.")

restore

* Group time trends
reghdfe terratt *bigfishtarget *bigfishdied *dronestrike, absorb(i.groupid##c.periodid i.groupid) vce(, bw(12))
Fstats

outreg2 using tables/Rigterink_ATabB3, append label tex(frag)  ///
keep(bigfishdied L*_bigfishdied) ///
adds("p-val lags hit", e(lagF), "p-val leads hit", e(leadF), "p-val lags targeted", e(lagFtarget), "p-val leads targeted", e(leadFtarget), "Control mean", e(cmean)) adec(4) ///
addtext("Includes 6 leads", "YES", "Group FE", "YES", "Month FE", "NO", "Group-Month trend", "YES",  "Standard errors", "N. West") ///
nonotes addnote("Standard errors in parentheses", "* p<0.1 ** p<0.05 *** p<0.01") ///
ctitle("Baseline", "Terr.att.")

* Different standard errors
* HAC
reghdfe terratt *bigfishtarget *bigfishdied *dronestrike, absorb(i.groupid i.periodid) vce(robust, bw(12))
Fstats

outreg2 using tables/Rigterink_ATabB3, append label tex(frag)  ///
keep(bigfishdied L*_bigfishdied) ///
adds("p-val lags hit", e(lagF), "p-val leads hit", e(leadF), "p-val lags targeted", e(lagFtarget), "p-val leads targeted", e(leadFtarget), "Control mean", e(cmean)) adec(4) ///
addtext("Includes 6 leads", "YES", "Group FE", "YES", "Month FE", "YES", "Group-Month trend", "NO",  "Standard errors", "HAC") ///
nonotes addnote("Standard errors in parentheses", "* p<0.1 ** p<0.05 *** p<0.01") ///
ctitle("Baseline", "Terr.att.")

* Different standard errors
* Auto-correlated disturbances (Driscoll-Kraay)
reghdfe terratt *bigfishtarget *bigfishdied *dronestrike, absorb(i.groupid i.periodid) vce(cluster periodid, bw(12))
Fstats

outreg2 using tables/Rigterink_ATabB3, append label tex(frag)  ///
keep(bigfishdied L*_bigfishdied) ///
adds("p-val lags hit", e(lagF), "p-val leads hit", e(leadF), "p-val lags targeted", e(lagFtarget), "p-val leads targeted", e(leadFtarget), "Control mean", e(cmean)) adec(4) ///
addtext("Includes 6 leads", "YES", "Group FE", "YES", "Month FE", "YES", "Group-Month trend", "NO",  "Standard errors", "Drisc.-Kr.") ///
nonotes addnote("Standard errors in parentheses", "* p<0.1 ** p<0.05 *** p<0.01") ///
ctitle("Baseline", "Terr.att.")


*** Unconditional Negative Binomial

* No lags and leads for Likelihood Ratio test
glm terratt_unlog bigfishdied F?_bigfishdied *bigfishtarget *dronestrike i.groupid i.periodid, family(nb ml) vce(cluster groupid)
scalar ll_nb_nolag = e(ll)

glm terratt_unlog bigfishdied L?_bigfishdied *bigfishtarget *dronestrike i.groupid i.periodid, family(nb ml) vce(cluster groupid)
scalar ll_nb_nolead = e(ll)

glm terratt_unlog bigfishtarget F?_bigfishtarget *bigfishdied *dronestrike i.groupid i.periodid, family(nb ml) vce(cluster groupid)
scalar ll_nb_nolagtarget = e(ll)

glm terratt_unlog bigfishtarget L?_bigfishtarget *bigfishdied *dronestrike i.groupid i.periodid, family(nb ml) vce(cluster groupid)
scalar ll_nb_noleadtarget = e(ll)

* Actual model
glm terratt_unlog *bigfishtarget *bigfishdied i.groupid i.periodid *dronestrike, family(nb ml) vce(cluster groupid)
Fstats
scalar ll_nb = e(ll)

local Flag = chi2tail(2, 2*(abs(ll_nb_nolag-ll_nb)))
local Flead = chi2tail(2, 2*(abs(ll_nb_nolead-ll_nb)))
local Flagtarget = chi2tail(2, 2*(abs(ll_nb_nolagtarget-ll_nb)))
local Fleadtarget = chi2tail(2, 2*(abs(ll_nb_noleadtarget-ll_nb)))

outreg2 using tables/Rigterink_ATabB3, append label tex(frag)  ///
keep(bigfishdied L*_bigfishdied) ///
adds("p-val lags hit", `Flag', "p-val leads hit", `Flead', "p-val lags targeted", `Flagtarget', "p-val leads targeted", `Fleadtarget', "Control mean", e(cmean)) adec(4) ///
addtext("Includes 6 leads", "YES", "Group FE", "YES", "Month FE", "YES", "Group-Month trend", "NO",  "Standard errors", "Clustered") ///
nonotes addnote("Standard errors in parentheses", "* p<0.1 ** p<0.05 *** p<0.01") ///
ctitle("Uncond.", "Neg. bin.", "Terr.att.")

*** Conditional Negative Binomial

* No lags and leads for Likelihood Ratio Test
xtnbreg terratt_unlog bigfishdied F?_bigfishdied *bigfishtarget *dronestrike i.periodid, fe
scalar ll_nbcond_nolag = e(ll)

xtnbreg terratt_unlog bigfishdied L?_bigfishdied *bigfishtarget *dronestrike i.periodid, fe
scalar ll_nbcond_nolead = e(ll)

xtnbreg terratt_unlog bigfishtarget F?_bigfishtarget *bigfishdied *dronestrike i.periodid, fe iterate(100)
scalar ll_nbcond_nolagtarget = e(ll)

xtnbreg terratt_unlog bigfishtarget L?_bigfishtarget *bigfishdied *dronestrike i.periodid, fe iterate(100)
scalar ll_nbcond_noleadtarget = e(ll)

* Actual model
xtnbreg terratt_unlog *bigfishtarget *bigfishdied *dronestrike i.periodid, fe 
Fstats
scalar ll_nbcond = e(ll)

local Flag = chi2tail(2, 2*(abs(ll_nbcond_nolag-ll_nbcond)))
local Flead = chi2tail(2, 2*(abs(ll_nbcond_nolead-ll_nbcond)))
local Flagtarget = chi2tail(2, 2*(abs(ll_nbcond_nolagtarget-ll_nbcond)))
local Fleadtarget = chi2tail(2, 2*(abs(ll_nbcond_noleadtarget-ll_nbcond)))

outreg2 using tables/Rigterink_ATabB3, append label tex(frag)  ///
keep(bigfishdied L*_bigfishdied) ///
adds("p-val lags hit", `Flag', "p-val leads hit", `Flead', "p-val lags targeted", `Flagtarget', "p-val leads targeted", `Fleadtarget', "Control mean", e(cmean)) adec(4) ///
addtext("Includes 6 leads", "YES", "Group FE", "YES", "Month FE", "YES", "Group-Month trend", "NO",  "Standard errors", "IOM") ///
nonotes addnote("Standard errors in parentheses", "* p<0.1 ** p<0.05 *** p<0.01") ///
ctitle("Cond.", "Neg. bin.", "Terr.att.")


******************
*** Table B.4  ***
******************

use "dta/Rigterink_drones_replication_maindataset.dta", clear

* Baseline model
reghdfe terratt F*bigfishtarget bigfishtarget L*_bigfishtarget F*bigfishdied bigfishdied L*_bigfishdied *dronestrike, absorb(i.groupid i.periodid) vce(, bw(12))
Fstats

outreg2 using tables/Rigterink_ATabB4, replace label tex(frag)  ///
keep(bigfishdied L*_bigfishdied) ///
adds("Prob $>$ F lags hit", e(lagF), "Prob $>$ F leads hit", e(leadF), "Prob $>$ F lags targeted", e(lagFtarget), "Prob $>$ F leads targeted", e(leadFtarget), "Control mean", e(cmean)) adec(4) ///
addtext("Group FE", "YES", "Period FE", "YES", "Region FE", "NO", "Region-group FE", "NO", "Region-period FE", "NO") ///
nonotes addnote("Newey-West standard errors in parentheses, column (9) displays HAC standard errors", "* p<0.1 ** p<0.05 *** p<0.01") ///
ctitle("Baseline", "Terr.att.")

* Counterfactual: any strike
reghdfe terratt *dronestrikedum *bigfishdied, absorb(i.groupid i.periodid) vce(, bw(12))
Fstats
outreg2 using tables/Rigterink_ATabB4, append label tex(frag)  ///
keep(bigfishdied L*_bigfishdied) ///
adds("Prob $>$ F lags hit", e(lagF), "Prob $>$ F leads hit", e(leadF), "Control mean", e(cmean)) adec (4) ///
addtext("Group FE", "YES", "Period FE", "YES", "Region FE", "NO", "Region-group FE", "NO", "Region-period FE", "NO") ///
nonotes addnote("Newey-West standard errors in parentheses", "* p<0.1 ** p<0.05 *** p<0.01") ///
ctitle("Cntrfac:", "drone strike", "Terr.att.")

* Counterfactual: big fish named
reghdfe terratt *bigfishinv *bigfishdied *dronestrike, absorb(i.groupid i.periodid) vce(, bw(12))
Fstats

outreg2 using tables/Rigterink_ATabB4, append label tex(frag)  ///
keep(bigfishdied L*_bigfishdied) ///
adds("Prob $>$ F lags hit", e(lagF), "Prob $>$ F leads hit", e(leadF), "Control mean", e(cmean)) adec (4) ///
addtext("Group FE", "YES", "Period FE", "YES", "Region FE", "NO", "Region-group FE", "NO", "Region-period FE", "NO") ///
nonotes addnote("Newey-West standard errors in parentheses", "* p<0.1 ** p<0.05 *** p<0.01") ///
ctitle("Cntrfac:", "leader named", "Terr.att.")

* Drop dates from 09/2015 onwards
reghdfe terratt *bigfishtarget *bigfishdied *dronestrike if year!=2015 | (year==2015&month<9), absorb(i.groupid i.periodid) vce(, bw(12))
Fstats

outreg2 using tables/Rigterink_ATabB4, append label tex(frag)  ///
keep(bigfishdied L*_bigfishdied) ///
adds("Prob $>$ F lags hit", e(lagF), "Prob $>$ F leads hit", e(leadF), "Prob $>$ F lags targeted", e(lagFtarget), "Prob $>$ F leads targeted", e(leadFtarget), "Control mean", e(cmean)) ///
addtext("Group FE", "YES", "Period FE", "YES", "Region FE", "NO", "Region-group FE", "NO", "Region-period FE", "NO") ///
nonotes addnote("Newey-West standard errors in parentheses", "* p<0.1 ** p<0.05 *** p<0.01") ///
ctitle("Only $<$", "Sept. 2015", "Terr.att.")

* Dropping two small groups

reghdfe terratt *bigfishtarget *bigfishdied *dronestrike if groupid!=2 & groupid!=3, absorb(i.groupid i.periodid) vce(, bw(12))
Fstats

outreg2 using tables/Rigterink_ATabB4, append label tex(frag)  ///
keep(bigfishdied L*_bigfishdied) ///
adds("Prob $>$ F lags hit", e(lagF), "Prob $>$ F leads hit", e(leadF), "Prob $>$ F lags targeted", e(lagFtarget), "Prob $>$ F leads targeted", e(leadFtarget), "Control mean", e(cmean)) adec(4) ///
addtext("Group FE", "YES", "Period FE", "YES", "Region FE", "NO", "Region-group FE", "NO", "Region-period FE", "NO") ///
nonotes addnote("Newey-West standard errors in parentheses", "* p<0.1 ** p<0.05 *** p<0.01") ///
ctitle("Drop 2", "small gr.", "Terr.att.")

*** Region-group-month models

use "dta\Rigterink_drones_replication_regiongroup.dta", clear

* Region-fixed effects

reghdfe terratt *bigfishtarget *bigfishdied *dronestrike, absorb(i.groupid i.periodid i.regionid) vce(, bw(12))
Fstats

outreg2 using tables/Rigterink_ATabB4, append label tex(frag)  ///
keep(bigfishdied L*_bigfishdied) ///
adds("Prob $>$ F lags hit", e(lagF), "Prob $>$ F leads hit", e(leadF), "Prob $>$ F lags targeted", e(lagFtarget), "Prob $>$ F leads targeted", e(leadFtarget), "Control mean", e(cmean)) ///
addtext("Group FE", "YES", "Period FE", "YES", "Region FE", "YES", "Region-group FE", "NO", "Region-period FE", "NO") ///
nonotes addnote("Newey-West standard errors in parentheses", "* p<0.1 ** p<0.05 *** p<0.01") ///
ctitle("Region-", "Gr.-mnth", "Terr.att.")

* Region-group-fixed effects

reghdfe terratt *bigfishtarget *bigfishdied *dronestrike, absorb(i.periodid i.regionid#i.groupid) vce(, bw(12))
Fstats

outreg2 using tables/Rigterink_ATabB4, append label tex(frag)  ///
keep(bigfishdied L*_bigfishdied) ///
adds("Prob $>$ F lags hit", e(lagF), "Prob $>$ F leads hit", e(leadF), "Prob $>$ F lags targeted", e(lagFtarget), "Prob $>$ F leads targeted", e(leadFtarget), "Control mean", e(cmean)) ///
addtext("Group FE", "NO", "Period FE", "YES", "Region FE", "NO", "Region-group FE", "YES", "Region-period FE", "NO") ///
nonotes addnote("Newey-West standard errors in parentheses", "* p<0.1 ** p<0.05 *** p<0.01") ///
ctitle("Region-", "Gr.-mnth", "Terr.att.")

* Region-group-fixed effects

reghdfe terratt *bigfishtarget *bigfishdied *dronestrike, absorb(i.groupid i.regionid#i.periodid) vce(, bw(12))
Fstats

outreg2 using tables/Rigterink_ATabB4, append label tex(frag)  ///
keep(bigfishdied L*_bigfishdied) ///
adds("Prob $>$ F lags hit", e(lagF), "Prob $>$ F leads hit", e(leadF), "Prob $>$ F lags targeted", e(lagFtarget), "Prob $>$ F leads targeted", e(leadFtarget), "Control mean", e(cmean)) ///
addtext("Group FE", "YES", "Period FE", "NO", "Region FE", "NO", "Region-group FE", "NO", "Region-period FE", "YES") ///
nonotes addnote("Newey-West standard errors in parentheses", "* p<0.1 ** p<0.05 *** p<0.01") ///
ctitle("Region-", "Gr.-mnth", "Terr.att.")

* Expanded sample including all groups in Pakistan or Afghanistan

use "dta\Rigterink_drones_replication_expsample.dta", clear

reghdfe terratt F*bigfishtarget bigfishtarget L*_bigfishtarget F*bigfishdied bigfishdied L*_bigfishdied *dronestrike, absorb(i.groupid i.periodid) vce(robust, bw(12))
Fstats

outreg2 using tables/Rigterink_ATabB4, append label tex(frag) ///
keep(bigfishdied L*_bigfishdied) ///
adds("Prob $>$ F lags hit", e(lagF), "Prob $>$ F leads hit", e(leadF), "Prob $>$ F lags targeted", e(lagFtarget), "Prob $>$ F leads targeted", e(leadFtarget), "Control mean", e(cmean)) adec(4) ///
addtext("Group FE", "YES", "Period FE", "YES", "Region FE", "NO", "Region-group FE", "NO", "Region-period FE", "NO") ///
nonotes addnote("Newey-West standard errors in parentheses, column (9) displays HAC standard errors", "* p<0.1 ** p<0.05 *** p<0.01") ///
ctitle("Exp.", "sample", "Terr.att.")


**********************************************
*** NOTE: Figure B.10 is in separate file  ***
**********************************************

* Rigterink_drones_replication_appendix_randinf.do


******************
*** Table B.5  ***
******************

use "dta/Rigterink_drones_replication_maindataset.dta", clear

* Running main specification with different numbers of leads and lags

drop L4* L5* L6* F4* F5* F6*

local lincom = "L1_bigfishdied+L2_bigfishdied+L3_bigfishdied"
local pvals = "`pval1', `pval2', `pval3'"

foreach i in 4 5 6 7 8 9 10 11 12 13 14 15 {
	foreach X of varlist bigfishtarget bigfishdied dronestrike {
		gen L`i'_`X' = L`i'.`X'
		label var L`i'_`X' "t-`i'"
		gen F`i'_`X' = F`i'.`X'
		label var F`i'_`X' "t+`i'"
	}
	
	local lincom = "`lincom'" + "+ L`i'_bigfishdied"

	reghdfe terratt L*_bigfishdied L*_bigfishtarget bigfishtarget F*_bigfishtarget  bigfishdied F*_bigfishdied *dronestrike, absorb(i.groupid i.periodid) vce(, bw(`i'))
	estimates store M`i'
	matrix coefsLL`i' = r(table)
	
	forvalues b = 1(1)15 {
		local pval`b' = 999
	}
	
	forvalues j = 1(1)`i' {
		local pval`j' = coefsLL`i'[4,`j']
	}
	
	* Storing result in matrix
	matrix LL = (`pval1', `pval2', `pval3', `pval4', `pval5', `pval6', `pval7', `pval8', `pval9', `pval10', `pval11', `pval12', `pval13', `pval14', `pval15')
					
	if `i'==4 {
		matrix allLL = LL
	}
	else {
		matrix allLL = (allLL \ LL)
	}
	
	
	testparm L*_bigfishdied
	local lagF`i' = round(r(p), 0.01)
	testparm F*_bigfishdied
	local leadF`i' = round(r(p), 0.01)
	
}


* Transforming matrix to dataset
clear
svmat allLL

for var _all: replace X = . if X==999 \ replace X = round(X, 0.001)

gen nolags = 3+_n
order nolags

* Labelling
label var nolags "\# L\&L"

forvalues i = 1(1)15 {
	label var allLL`i' "t+`i'"
}


* Outputting table
texsave using "tables/Rigterink_ATabB5.tex", replace nofix varlab frag title("p-values on lags of hit when varying number of leads and lags (L\&L) included") location(h) marker("Atab:LL") footnote("This table displays the p-value for each lag of hit when varying the number of leads and lags of hit, target and control variables between 4 and 15")


********************
*** Figure B.11  ***
********************

use "dta/Rigterink_drones_replication_maindataset.dta", clear

reghdfe infight *bigfishtarget *bigfishdied *dronestrike, absorb(i.groupid i.periodid) vce(,bw(12))
Fstats

* p-values F-test for graphs

testparm L*_bigfishdied
local lagF = round(r(p), 0.0001)
testparm F*_bigfishdied
local leadF = round(r(p), 0.0001)
testparm L*_bigfishtarget
local lagFtarget = round(r(p), 0.0001)
testparm F*_bigfishtarget
local leadFtarget = round(r(p), 0.0001)

* Producing graph
coefplot, vert keep(*bigfishdied) order(F6* F5* F4* F3* F2* F1* bigfishdied L*) title("Infighting") ytitle("Coefficient estimate on hit") ///
ytitle("Coefficient estimate on hit") ///
groups(L*_bigfishdied = "Prob $>$ F lags: `: di %9.4f `lagF''" F*_bigfishdied = "Prob $>$ F leads: `: di %9.4f `leadF''", nogap) ///
plotregion(style(none)) graphregion(ifcolor(white) fcolor(white) color(white) icolor(white)) ///
mcolor(black) ciopts(lcolor(black) recast(rcap))
graph export graphs/Rigterink_AFigB11.pdf, replace


/*----------------------------------------------------------
------------------------ Section C -------------------------
----------------------------------------------------------*/

*******************
*** Figure C.12 ***
*******************

use dta/Rigterink_drones_replication_affiliates.dta, clear

graph twoway bar affildum24att parentid, color(white) lcolor(black) lwidth(thin) barw(0.75)|| ///
bar affildum23att parentid, color(gs14) lcolor(black) lwidth(thin) barw(0.75) || ///
bar affildum22att parentid, color(white) lcolor(black) lwidth(thin) barw(0.75) || ///
bar affildum21att parentid, color(gs11) lcolor(black) lwidth(thin) barw(0.75) || ///
bar affildum20att parentid, color(white) lcolor(black) lwidth(thin) barw(0.75) || ///
bar affildum19att parentid, color(white) lcolor(black) lwidth(thin) barw(0.75) || ///
bar affildum18att parentid, color(white) lcolor(black) lwidth(thin) barw(0.75) || ///
bar affildum17att parentid, color(white) lcolor(black) lwidth(thin) barw(0.75) || ///
bar affildum16att parentid, color(white) lcolor(black) lwidth(thin) barw(0.75) || ///
bar affildum15att parentid, color(white) lcolor(black) lwidth(thin) barw(0.75) || ///
bar affildum14att parentid, color(gs8) lcolor(black) lwidth(thin) barw(0.75) || ///
bar affildum13att parentid, color(white) lcolor(black) lwidth(thin) barw(0.75) || ///
bar affildum12att parentid, color(white) lcolor(black) lwidth(thin) barw(0.75) || ///
bar affildum11att parentid, color(white) lcolor(black) lwidth(thin) barw(0.75) || ///
bar affildum10att parentid, color(white) lcolor(black) lwidth(thin) barw(0.75) || ///
bar affildum9att parentid, color(white) lcolor(black) lwidth(thin) barw(0.75) || ///
bar affildum8att parentid, color(white) lcolor(black) lwidth(thin) barw(0.75) || ///
bar affildum7att parentid, color(white) lcolor(black) lwidth(thin) barw(0.75) || ///
bar affildum6att parentid, color(white) lcolor(black) lwidth(thin) barw(0.75) || ///
bar affildum5att parentid, color(gs5) lcolor(black) lwidth(thin) barw(0.75) || ///
bar affildum4att parentid, color(white) lcolor(black) lwidth(thin) barw(0.75) || ///
bar affildum3att parentid, color(white) lcolor(black) lwidth(thin) barw(0.75) || ///
bar affildum2att parentid, color(white) lcolor(black) lwidth(thin) barw(0.75) || ///
bar affildum1att parentid, color(white) lcolor(black) lwidth(thin) barw(0.75) || ///
scatter rowmaxaffil24 parentid, ms(none) mlabel(rowmaxaffil24) mlabpos(12) mlabcolor(black) || ///
scatter affildum14att parentid if affildum14att!=0, ms(none) mlabel(affildum14) mlabpos(6) mlabcolor(black) mlabsize(vsmall) || ///
scatter affildum5att parentid if affildum5att!=0, ms(none) mlabel(affildum5) mlabpos(6) mlabcolor(black) mlabsize(vsmall) || ///
scatter affildum23att parentid if affildum23att!=0, ms(none) mlabel(affildum23) mlabpos(6) mlabcolor(black) mlabsize(vsmall) || ///
scatter affildum21att parentid if affildum21att!=0, ms(none) mlabel(affildum21) mlabpos(6) mlabcolor(black) mlabsize(vsmall) ///
legend(off) xlabel(1(1)8, valuelabel angle(45)) xtitle("") ytitle("Terrorist attacks by affiliates") ///
plotregion(style(none)) graphregion(ifcolor(white) fcolor(white) color(white) icolor(white)) 

graph export graphs/Rigterink_AFigC12.pdf, replace


******************
*** Table C.1  ***
******************

use dta/Rigterink_drones_replication_maindataset.dta, clear

* At group-month level

reghdfe stanfordaffil *bigfishtarget *bigfishdied *dronestrike, absorb(i.groupid i.periodid) vce(, bw(12))
Fstats

outreg2 using tables/Rigterink_ATabC1, replace label tex(frag)  ///
keep(bigfishdied L*_bigfishdied) ///
adds("Prob $>$ F lags hit", e(lagF), "Prob $>$ F leads hit", e(leadF), "Prob $>$ F lags targeted", e(lagFtarget), "Prob $>$ F leads targeted", e(leadFtarget), "Control mean", e(cmean)) adec(4) ///
addtext("Model", "Gr.-mnth", "Group FE", "YES", "Period FE", "YES", "Affiliate FE", "NO") ///
nonotes addnote("Newey-West standard errors in parentheses", "* p<0.1 ** p<0.05 *** p<0.01")

* At group-month level excluding AQ

reghdfe stanfordaffil *bigfishtarget *bigfishdied *dronestrike if groupid!=1, absorb(i.groupid i.periodid) vce(, bw(12))
Fstats

outreg2 using tables/Rigterink_ATabC1, append label tex(frag) ///
keep(bigfishdied L*_bigfishdied) ///
adds("Prob $>$ F lags hit", e(lagF), "Prob $>$ F leads hit", e(leadF), "Prob $>$ F lags targeted", e(lagFtarget), "Prob $>$ F leads targeted", e(leadFtarget), "Control mean", e(cmean))  adec(4) ///
addtext("Model", "Gr.-mnth", "Group FE", "YES", "Period FE", "YES", "Affiliate FE", "NO") ///
nonotes addnote("Newey-West standard errors in parentheses", "* p<0.1 ** p<0.05 *** p<0.01") ///
ctitle("Affil. att.", "excl. AQ")

*** Affiliate-month level

use dta/Rigterink_drones_replication_affilmonthleveldata.dta, clear

preserve

rename (*stanfordparentdied *stanfordparenttarget) (*bigfishdied *bigfishtarget)

* Affiliate-month level

reghdfe affilatt bigfishdied bigfishtarget ??_bigfishdied ??_bigfishtarget *ownbigfishtarget *ownbigfishdied *stanfordparentdronestrike *owndronestrike if affilAQ!=1, absorb(i.affilgroupid i.periodid) vce(, bw(12))
affilFstats

outreg2 using tables/Rigterink_ATabC1, append label tex(frag)  ///
keep(bigfishdied L?_bigfishdied) ///
adds("Prob $>$ F lags parent hit", e(lagF), "Prob $>$ F leads parent hit", e(leadF), "Prob $>$ F lags parent targeted", e(lagFtarget1), "Prob $>$ F leads parent targeted", e(leadFtarget1), "Prob $>$ F lags affil. hit", e(lagFown), "Prob $>$ F leads affil. hit", e(leadFown), "Control mean", e(cmean)) adec(4) ///
addtext("Model", "Affil.-mnth", "Group FE", "NO", "Period FE", "YES", "Affiliate FE", "YES") ///
nonotes addnote("Newey-West standard errors in parentheses", "* p<0.1 ** p<0.05 *** p<0.01")

restore 

* Affiliate-month level xcluding ISIS

preserve 

rename (*stanfordparentdied *stanfordparenttarget) (*bigfishdied *bigfishtarget)
drop if affilgroupid==47

reghdfe affilatt bigfishdied bigfishtarget ??_bigfishdied ??_bigfishtarget *ownbigfishtarget *ownbigfishdied *stanfordparentdronestrike *owndronestrike if affilAQ!=1, absorb(i.affilgroupid i.periodid) vce(, bw(12))
affilFstats

outreg2 using tables/Rigterink_ATabC1, append label tex(frag)  ///
keep(bigfishdied L?_bigfishdied) ///
adds("Prob $>$ F lags parent hit", e(lagF), "Prob $>$ F leads parent hit", e(leadF), "Prob $>$ F lags parent targeted", e(lagFtarget1), "Prob $>$ F leads parent targeted", e(leadFtarget1), "Prob $>$ F lags affil. hit", e(lagFown), "Prob $>$ F leads affil. hit", e(leadFown), "Control mean", e(cmean)) adec(4) ///
addtext("Model", "Affil.-mnth", "Group FE", "NO", "Period FE", "YES", "Affiliate FE", "YES") ///
nonotes addnote("Newey-West standard errors in parentheses", "* p<0.1 ** p<0.05 *** p<0.01") ///
ctitle("Affil. att.", "excl. ISIS")

restore 


******************
*** Table C.2  ***
******************

use dta/Rigterink_drones_replication_maindataset.dta, clear

* % successful attacks
reghdfe stanfordsuccess *bigfishtarget *bigfishdied *dronestrike, absorb(i.groupid i.periodid) vce(, bw(12))
Fstats

outreg2 using tables/Rigterink_ATabC2, replace label tex(frag)  ///
keep(bigfishdied L*_bigfishdied) ///
adds("Prob $>$ F lags hit", e(lagF), "Prob $>$ F leads hit", e(leadF), "Prob $>$ F lags targeted", e(lagFtarget), "Prob $>$ F leads targeted", e(leadFtarget), "Control mean", e(cmean)) adec(4) ///
addtext("Model", "Gr.-mnth", "Group FE", "YES", "Period FE", "YES") ///
nonotes addnote("Newey-West standard errors in parentheses", "* p<0.1 ** p<0.05 *** p<0.01") ///
ctitle("%", "success", "Affil.att.")

* Mean # victims
reghdfe stanfordmeanndead *bigfishtarget *bigfishdied *dronestrike, absorb(i.groupid i.periodid) vce(, bw(12))
Fstats

outreg2 using tables/Rigterink_ATabC2, append label tex(frag)  ///
keep(bigfishdied L*_bigfishdied) ///
adds("Prob $>$ F lags hit", e(lagF), "Prob $>$ F leads hit", e(leadF), "Prob $>$ F lags targeted", e(lagFtarget), "Prob $>$ F leads targeted", e(leadFtarget), "Control mean", e(cmean)) adec(4) ///
addtext("Model", "Gr.-mnth", "Group FE", "YES", "Period FE", "YES") ///
nonotes addnote("Newey-West standard errors in parentheses", "* p<0.1 ** p<0.05 *** p<0.01") ///
ctitle("mean", "# vics.", "Affil.att.")

* Civilian targets
reghdfe stanfordtargetciv *bigfishtarget *bigfishdied *dronestrike, absorb(i.groupid i.periodid) vce(, bw(12))
Fstats

outreg2 using tables/Rigterink_ATabC2, append label tex(frag)  ///
keep(bigfishdied L*_bigfishdied) ///
adds("Prob $>$ F lags hit", e(lagF), "Prob $>$ F leads hit", e(leadF), "Prob $>$ F lags targeted", e(lagFtarget), "Prob $>$ F leads targeted", e(leadFtarget), "Control mean", e(cmean)) adec(4) ///
addtext("Model", "Gr.-mnth", "Group FE", "YES", "Period FE", "YES") ///
nonotes addnote("Newey-West standard errors in parentheses", "* p<0.1 ** p<0.05 *** p<0.01") ///
ctitle("Civilian", "Affil.att.")

* Private targets
reghdfe stanfordtargetpri *bigfishtarget *bigfishdied *dronestrike, absorb(i.groupid i.periodid) vce(, bw(12))
Fstats

outreg2 using tables/Rigterink_ATabC2, append label tex(frag)  ///
keep(bigfishdied L*_bigfishdied) ///
adds("Prob $>$ F lags hit", e(lagF), "Prob $>$ F leads hit", e(leadF), "Prob $>$ F lags targeted", e(lagFtarget), "Prob $>$ F leads targeted", e(leadFtarget), "Control mean", e(cmean)) adec(4) ///
addtext("Model", "Gr.-mnth", "Group FE", "YES", "Period FE", "YES") ///
nonotes addnote("Newey-West standard errors in parentheses", "* p<0.1 ** p<0.05 *** p<0.01") ///
ctitle("Private", "Affil.att.")

* Military targets
reghdfe stanfordtargetmil *bigfishtarget *bigfishdied *dronestrike, absorb(i.groupid i.periodid) vce(, bw(12))
Fstats

outreg2 using tables/Rigterink_ATabC2, append label tex(frag)  ///
keep(bigfishdied L*_bigfishdied) ///
adds("Prob $>$ F lags hit", e(lagF), "Prob $>$ F leads hit", e(leadF), "Prob $>$ F lags targeted", e(lagFtarget), "Prob $>$ F leads targeted", e(leadFtarget), "Control mean", e(cmean)) adec(4) ///
addtext("Model", "Gr.-mnth", "Group FE", "YES", "Period FE", "YES") ///
nonotes addnote("Newey-West standard errors in parentheses", "* p<0.1 ** p<0.05 *** p<0.01") ///
ctitle("Military", "Affil.att.")

* Attacks with US victim
reghdfe stanfordkillwoundus *bigfishtarget *bigfishdied *dronestrike, absorb(i.groupid i.periodid) vce(, bw(12))
Fstats

outreg2 using tables/Rigterink_ATabC2, append label tex(frag)  ///
keep(bigfishdied L*_bigfishdied) ///
adds("Prob $>$ F lags hit", e(lagF), "Prob $>$ F leads hit", e(leadF), "Prob $>$ F lags targeted", e(lagFtarget), "Prob $>$ F leads targeted", e(leadFtarget), "Control mean", e(cmean)) adec(4) ///
addtext("Model", "Gr.-mnth", "Group FE", "YES", "Period FE", "YES") ///
nonotes addnote("Newey-West standard errors in parentheses", "* p<0.1 ** p<0.05 *** p<0.01") ///
ctitle("US vic.", "Affil.att.")


******************
*** Table C.3  ***
******************

use dta/Rigterink_drones_replication_affilmonthleveldata.dta, clear

reghdfe p_success *stanfordparentdied *stanfordparenttarget *ownbigfishtarget *ownbigfishdied *stanfordparentdronestrike *owndronestrike if affilAQ!=1, absorb(i.affilgroupid i.periodid) vce(, bw(12))
affilFstats

outreg2 using tables/Rigterink_ATabC3, replace label tex(frag)  ///
keep(stanfordparentdied L*_stanfordparentdied) ///
adds("Prob $>$ F lags parent hit", e(lagFparent), "Prob $>$ F leads parent hit", e(leadFparent), "Prob $>$ F lags parent targeted", e(lagFtarget), "Prob $>$ F leads parent targeted", e(leadFtarget), "Prob $>$ F lags affil. hit", e(lagFown), "Prob $>$ F leads affil. hit", e(leadFown), "Control mean", e(acmean)) adec(4) ///
addtext("Model", "Affil.-mnth", "Group FE", "NO", "Period FE", "YES", "Affiliate FE", "YES") ///
nonotes addnote("Newey-West standard errors in parentheses", "* p<0.1 ** p<0.05 *** p<0.01") ///
ctitle("%", "success", "Affil.att.")

reghdfe meanndead *stanfordparentdied *stanfordparenttarget *ownbigfishtarget *ownbigfishdied *stanfordparentdronestrike *owndronestrike if affilAQ!=1, absorb(i.affilgroupid i.periodid) vce(, bw(12))
affilFstats

outreg2 using tables/Rigterink_ATabC3, append label tex(frag)  ///
keep(stanfordparentdied L*_stanfordparentdied) ///
adds("Prob $>$ F lags parent hit", e(lagFparent), "Prob $>$ F leads parent hit", e(leadFparent), "Prob $>$ F lags parent targeted", e(lagFtarget), "Prob $>$ F leads parent targeted", e(leadFtarget), "Prob $>$ F lags affil. hit", e(lagFown), "Prob $>$ F leads affil. hit", e(leadFown), "Control mean", e(acmean)) adec(4) ///
addtext("Model", "Affil.-mnth", "Group FE", "NO", "Period FE", "YES", "Affiliate FE", "YES") ///
nonotes addnote("Newey-West standard errors in parentheses", "* p<0.1 ** p<0.05 *** p<0.01") ///
ctitle("mean", "# vics.", "Affil.att.")

reghdfe targetciv *stanfordparentdied *stanfordparenttarget *ownbigfishtarget *ownbigfishdied *stanfordparentdronestrike *owndronestrike if affilAQ!=1, absorb(i.affilgroupid i.periodid) vce(, bw(12))
affilFstats

outreg2 using tables/Rigterink_ATabC3, append label tex(frag)  ///
keep(stanfordparentdied L*_stanfordparentdied) ///
adds("Prob $>$ F lags parent hit", e(lagFparent), "Prob $>$ F leads parent hit", e(leadFparent), "Prob $>$ F lags parent targeted", e(lagFtarget), "Prob $>$ F leads parent targeted", e(leadFtarget), "Prob $>$ F lags affil. hit", e(lagFown), "Prob $>$ F leads affil. hit", e(leadFown), "Control mean", e(acmean)) adec(4) ///
addtext("Model", "Affil.-mnth", "Group FE", "NO", "Period FE", "YES", "Affiliate FE", "YES") ///
nonotes addnote("Newey-West standard errors in parentheses", "* p<0.1 ** p<0.05 *** p<0.01") ///
ctitle("Civilian", "Affil.att.")

reghdfe targetpri *stanfordparentdied *stanfordparenttarget *ownbigfishtarget *ownbigfishdied *stanfordparentdronestrike *owndronestrike if affilAQ!=1, absorb(i.affilgroupid i.periodid) vce(, bw(12))
affilFstats

outreg2 using tables/Rigterink_ATabC3, append label tex(frag)  ///
keep(stanfordparentdied L*_stanfordparentdied) ///
adds("Prob $>$ F lags parent hit", e(lagFparent), "Prob $>$ F leads parent hit", e(leadFparent), "Prob $>$ F lags parent targeted", e(lagFtarget), "Prob $>$ F leads parent targeted", e(leadFtarget), "Prob $>$ F lags affil. hit", e(lagFown), "Prob $>$ F leads affil. hit", e(leadFown), "Control mean", e(acmean)) adec(4) ///
addtext("Model", "Affil.-mnth", "Group FE", "NO", "Period FE", "YES", "Affiliate FE", "YES") ///
nonotes addnote("Newey-West standard errors in parentheses", "* p<0.1 ** p<0.05 *** p<0.01") ///
ctitle("Private", "Affil.att.")

reghdfe targetmil *stanfordparentdied *stanfordparenttarget *ownbigfishtarget *ownbigfishdied *stanfordparentdronestrike *owndronestrike if affilAQ!=1, absorb(i.affilgroupid i.periodid) vce(, bw(12))
affilFstats

outreg2 using tables/Rigterink_ATabC3, append label tex(frag)  ///
keep(stanfordparentdied L*_stanfordparentdied) ///
adds("Prob $>$ F lags parent hit", e(lagFparent), "Prob $>$ F leads parent hit", e(leadFparent), "Prob $>$ F lags parent targeted", e(lagFtarget), "Prob $>$ F leads parent targeted", e(leadFtarget), "Prob $>$ F lags affil. hit", e(lagFown), "Prob $>$ F leads affil. hit", e(leadFown), "Control mean", e(acmean)) adec(4) ///
addtext("Model", "Affil.-mnth", "Group FE", "NO", "Period FE", "YES", "Affiliate FE", "YES") ///
nonotes addnote("Newey-West standard errors in parentheses", "* p<0.1 ** p<0.05 *** p<0.01") ///
ctitle("Military", "Affil.att.")

reghdfe killwoundus *stanfordparentdied *stanfordparenttarget *ownbigfishtarget *ownbigfishdied *stanfordparentdronestrike *owndronestrike if affilAQ!=1, absorb(i.affilgroupid i.periodid) vce(, bw(12))
affilFstats

outreg2 using tables/Rigterink_ATabC3, append label tex(frag)  ///
keep(stanfordparentdied L*_stanfordparentdied) ///
adds("Prob $>$ F lags parent hit", e(lagFparent), "Prob $>$ F leads parent hit", e(leadFparent), "Prob $>$ F lags parent targeted", e(lagFtarget), "Prob $>$ F leads parent targeted", e(leadFtarget), "Prob $>$ F lags affil. hit", e(lagFown), "Prob $>$ F leads affil. hit", e(leadFown), "Control mean", e(acmean)) adec(4) ///
addtext("Model", "Affil.-mnth", "Group FE", "NO", "Period FE", "YES", "Affiliate FE", "YES") ///
nonotes addnote("Newey-West standard errors in parentheses", "* p<0.1 ** p<0.05 *** p<0.01") ///
ctitle("US vic.", "Affil.att.")

*******************
*** END OF FILE ***
*******************
